package com.spsy.pay.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.spsy.common.core.annotation.Excel;
import com.spsy.common.core.web.domain.BaseEntity;

/**
 * 支付订单对象 payment_order
 * 
 * @author ruoyi
 * @date 2025-09-15
 */
@Builder
public class PaymentOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 支付订单主键 */
    private Long id;

    /** 支付系统生成的唯一订单号（pay21344353498218） */
    @Excel(name = "支付系统生成的唯一订单号", readConverterExp = "p=ay21344353498218")
    private String orderNo;

    /** 商户id */
    @Excel(name = "商户id")
    private String merchantId;

    /** 商户名称 */
    @Excel(name = "商户名称")
    private String merchantName;

    /** 商户系统自己的订单号 */
    @Excel(name = "商户系统自己的订单号")
    private String merchantOrderNo;

    /** 订单总金额（单位：元，列如：100.00） */
    @Excel(name = "订单总金额", readConverterExp = "单=位：元，列如：100.00")
    private BigDecimal totalAmount;

    /** 优惠金额 */
    @Excel(name = "优惠金额")
    private BigDecimal discountAmount;

    /** 实际支付金额 = 总金额 - 优惠金额  */
    @Excel(name = "实际支付金额 = 总金额 - 优惠金额 ")
    private BigDecimal payAmount;

    /** 支付渠道 wechat-微信 alipay-支付宝 unionpay-银联 */
    @Excel(name = "支付渠道 wechat-微信 alipay-支付宝 unionpay-银联")
    private String payChannel;

    /** 支付方式 app-APP支付 scan-扫码支付 h5-H5支付 */
    @Excel(name = "支付方式 app-APP支付 scan-扫码支付 h5-H5支付")
    private String payMethod;

    /** 订单状态 0-待支付 1-支付中 2-支付成功 3-支付失败 4-已关闭 5-已退款 */
    @Excel(name = "订单状态 0-待支付 1-支付中 2-支付成功 3-支付失败 4-已关闭 5-已退款")
    private Integer orderStatus;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String productName;

    /** 商品详细描述 */
    @Excel(name = "商品详细描述")
    private String productDescription;

    /** 用户id */
    @Excel(name = "用户id")
    private String userId;

    /** 用户ip地址 */
    @Excel(name = "用户ip地址")
    private String userIp;

    /** 订单过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单过期时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expireTime;

    /** 支付成功时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付成功时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /** 第三方支付平台订单号 */
    @Excel(name = "第三方支付平台订单号")
    private String thirdOrderNo;

    /** 第三方返回的原始数据 */
    @Excel(name = "第三方返回的原始数据")
    private String thirdResponse;

    /** 支付结果通知地址 */
    @Excel(name = "支付结果通知地址")
    private String notifyUrl;

    /** 通知状态 0-未通知 1-通知中 2-通知成功 3-通知失败 */
    @Excel(name = "通知状态 0-未通知 1-通知中 2-通知成功 3-通知失败")
    private Integer notifyStatus;

    /** 通知次数 */
    @Excel(name = "通知次数")
    private Integer notifyCount;

    /** 错误代码 */
    @Excel(name = "错误代码")
    private String errorCode;

    /** 错误信息 */
    @Excel(name = "错误信息")
    private String errorMessage;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setOrderNo(String orderNo) 
    {
        this.orderNo = orderNo;
    }

    public String getOrderNo() 
    {
        return orderNo;
    }

    public void setMerchantId(String merchantId) 
    {
        this.merchantId = merchantId;
    }

    public String getMerchantId() 
    {
        return merchantId;
    }

    public void setMerchantName(String merchantName) 
    {
        this.merchantName = merchantName;
    }

    public String getMerchantName() 
    {
        return merchantName;
    }

    public void setMerchantOrderNo(String merchantOrderNo) 
    {
        this.merchantOrderNo = merchantOrderNo;
    }

    public String getMerchantOrderNo() 
    {
        return merchantOrderNo;
    }

    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) 
    {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getDiscountAmount() 
    {
        return discountAmount;
    }

    public void setPayAmount(BigDecimal payAmount) 
    {
        this.payAmount = payAmount;
    }

    public BigDecimal getPayAmount() 
    {
        return payAmount;
    }

    public void setPayChannel(String payChannel) 
    {
        this.payChannel = payChannel;
    }

    public String getPayChannel() 
    {
        return payChannel;
    }

    public void setPayMethod(String payMethod) 
    {
        this.payMethod = payMethod;
    }

    public String getPayMethod() 
    {
        return payMethod;
    }

    public void setOrderStatus(Integer orderStatus) 
    {
        this.orderStatus = orderStatus;
    }

    public Integer getOrderStatus() 
    {
        return orderStatus;
    }

    public void setProductName(String productName) 
    {
        this.productName = productName;
    }

    public String getProductName() 
    {
        return productName;
    }

    public void setProductDescription(String productDescription) 
    {
        this.productDescription = productDescription;
    }

    public String getProductDescription() 
    {
        return productDescription;
    }

    public void setUserId(String userId) 
    {
        this.userId = userId;
    }

    public String getUserId() 
    {
        return userId;
    }

    public void setUserIp(String userIp) 
    {
        this.userIp = userIp;
    }

    public String getUserIp() 
    {
        return userIp;
    }

    public void setExpireTime(Date expireTime) 
    {
        this.expireTime = expireTime;
    }

    public Date getExpireTime() 
    {
        return expireTime;
    }

    public void setPayTime(Date payTime) 
    {
        this.payTime = payTime;
    }

    public Date getPayTime() 
    {
        return payTime;
    }

    public void setThirdOrderNo(String thirdOrderNo) 
    {
        this.thirdOrderNo = thirdOrderNo;
    }

    public String getThirdOrderNo() 
    {
        return thirdOrderNo;
    }

    public void setThirdResponse(String thirdResponse) 
    {
        this.thirdResponse = thirdResponse;
    }

    public String getThirdResponse() 
    {
        return thirdResponse;
    }

    public void setNotifyUrl(String notifyUrl) 
    {
        this.notifyUrl = notifyUrl;
    }

    public String getNotifyUrl() 
    {
        return notifyUrl;
    }

    public void setNotifyStatus(Integer notifyStatus) 
    {
        this.notifyStatus = notifyStatus;
    }

    public Integer getNotifyStatus() 
    {
        return notifyStatus;
    }

    public void setNotifyCount(Integer notifyCount) 
    {
        this.notifyCount = notifyCount;
    }

    public Integer getNotifyCount() 
    {
        return notifyCount;
    }

    public void setErrorCode(String errorCode) 
    {
        this.errorCode = errorCode;
    }

    public String getErrorCode() 
    {
        return errorCode;
    }

    public void setErrorMessage(String errorMessage) 
    {
        this.errorMessage = errorMessage;
    }

    public String getErrorMessage() 
    {
        return errorMessage;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderNo", getOrderNo())
            .append("merchantId", getMerchantId())
            .append("merchantName", getMerchantName())
            .append("merchantOrderNo", getMerchantOrderNo())
            .append("totalAmount", getTotalAmount())
            .append("discountAmount", getDiscountAmount())
            .append("payAmount", getPayAmount())
            .append("payChannel", getPayChannel())
            .append("payMethod", getPayMethod())
            .append("orderStatus", getOrderStatus())
            .append("productName", getProductName())
            .append("productDescription", getProductDescription())
            .append("userId", getUserId())
            .append("userIp", getUserIp())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("expireTime", getExpireTime())
            .append("payTime", getPayTime())
            .append("thirdOrderNo", getThirdOrderNo())
            .append("thirdResponse", getThirdResponse())
            .append("notifyUrl", getNotifyUrl())
            .append("notifyStatus", getNotifyStatus())
            .append("notifyCount", getNotifyCount())
            .append("errorCode", getErrorCode())
            .append("errorMessage", getErrorMessage())
            .toString();
    }
}
